//home.js
import request from '@/utils/request'
// 通用的认证头部
const getAuthHeader = () => {
    return { 'Authorization': `Bearer ${localStorage ? localStorage.getItem('token') || '' : ''}` };
}

export function getBanners() {
    return request({
        url: '/banner/1',
        method: 'GET'
    })
}
export function getCourse(pageNum = 0, pageSize = 20, name = '') {
    return request({
        url: '/course/list',
        method: 'GET',
        headers: getAuthHeader(),
        params: {
            pageNum,
            pageSize,
            name
        }
    })
}
